<template>
    <div>
        <textarea v-model.lazy="info" ></textarea><br>
        <button @click="add">保存</button>
    </div>
</template>

<script>
export default {
    name: 'InputText',

    data() {
        return {
            info:''
        };
    },

    mounted() {
        
    },
    props:['addText'],
    methods: {
        add(){
            if(!this.info.trim()) return
            let data = {id:Date.now(),info:this.info,checked:false}
            this.addText(data)
            this.info = ''
        }
    },
};
</script>

<style scoped>
textarea{
    width: 500px;
    height: 80px;
}
button{
    background-color: pink;
}
</style>